package com.mystudyspring.studySpringBoot.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 静态资源自定义
 *
 * @author lix
 * @create 2018-03-23 15:54
 */
@Configuration
public class StaticSourceConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //http://localhost:8004/mystudyspring/t/resources/images/1.png
        registry.addResourceHandler("/mystudyspring/t/resources/**").addResourceLocations("classpath:/static/");
    }
}
